<div class="bigtitle">Danh mục loại tin rao &gt; <?=lang('label_update')?></div>
<table class='tblcontent' cellspacing='0' cellpadding='0' border='0'>
	<tr>
		<td>
			<?=form_open(site_url('list_type/update'),array('name'=>'frm','onsubmit'=>'return f_validate()'),array('hidden_status'=>'','hidden_id'=>$detail->id))?>			
			<table class='tblinputform' cellspacing='1' cellpadding='2' border='0' width='50%'>
				<tr>
					<th width='20%'>Loại địa ốc</th>
					<td width='80%'><input type='text' name='txt_type' style='width:300px;' maxlength='200' value='<?=$detail->categoryname?>'/></td>
				</tr>
				<tr>
					<td>Danh mục địa ốc</td>
					<td>
						<select style="width:300px" onchange="f_load_province(this.value)" name="txt_category">
							<? foreach($category as $row) {?>
								<? if($detail->categoryid == $row->id) {?>
									<option value="<?=$row->id?>" selected="selected"><?=get_content('realestate_category',$row->id)->name;?></option>
								<? } else {?>
								<option value="<?=$row->id?>"><?=get_content('realestate_category',$row->id)->name;?></option>
							<? } }?>
							</select>
					</td>
				</tr>
			</table>
			<div class='ctrlbtn'>
				<input type='button' name='btn_save' value='<?=lang('label_save')?>' onclick='return f_validate()'/>	
				<input type='button' name='btn_cancel' value='<?=lang('label_cancel')?>' onclick='window.location="<?=site_url('list_type')?>";'/>
			</div>
			<?=form_close()?>
		</td>
	</tr>
</table>
<script type='text/javascript'>
	f_onload();
	function f_onload(){ document.frm.txt_type.focus();}
	function f_validate(){
		form = document.frm;
		if(form.txt_type.value==''){
			alert("Vui lòng nhập địa ốc");
			form.txt_type.focus();
			return false;
		}
		form.submit();
	}
</script>